import java.sql.SQLOutput;
import java.util.Scanner;

public class StringPra {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str1 = scanner.nextLine();
        //判断字符串是否包含特定字符串TMD
        Boolean contains = str1.contains("TMD");
        if (contains) {
            System.out.println("字符串包含TMD");
            str1 = str1.replace("TMD", "***");
            System.out.println("替换后的字符串为：" + str1);
        }
    }
}
